<div class="modal-header">
    <h3 class="modal-title">日志清理配置</h3>
</div>
<div class="modal-body">
    <div style="margin-top: 5px;">
        <table class="table table-hover table-bordered table-striped">
            <thead>
            <tr>
                <td>服务器</td>
                <td>IP</td>
                <td>环境</td>
                <td>磁盘使用率</td>
                <td>归档(天)</td>
                <td>启用</td>
                <td>详情</td>
                <td ng-if="contains(authPoint, '/server/power')">操作</td>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>
                    <b style="color: #286090">{{item.serverName}}-{{item.serialNumber}}</b>
                </td>
                <td>
                    </span>{{item.serverDO.insideIp}}</span>
                </td>
                <td>
                    <b style="color: #777" ng-if="item.envType == 0">保留</b>
                    <b style="color: #5bc0de" ng-if="item.envType == 1">dev</b>
                    <b style="color: #449d44" ng-if="item.envType == 2">daily</b>
                    <b style="color: #ec971f" ng-if="item.envType == 3">gray</b>
                    <b style="color: #d9534f" ng-if="item.envType == 4">prod</b>
                    <b style="color: #5e5e5e" ng-if="item.envType == 5">test</b>
                    <b style="color: #286090" ng-if="item.envType == 6">back</b>
                    <b style="color: #ff5f87" ng-if="item.envType == 7">pre</b>
                </td>
                <td>
                    <div class="col-md-2">
                        <span class="label" ng-show="item.diskType == 'SYS'"
                              uib-popover-html="'SYSDISK'" popover-trigger="'mouseenter'"
                              style="background-color: #777; color: white;">
                            <i class="glyphicon glyphicon-hdd"></i>S</span>
                        <span class="label" ng-show="item.diskType == 'DATA'"
                              uib-popover-html="'DATADISK'" popover-trigger="'mouseenter'"
                              style="background-color: #777; color: white;">
                            <i class="glyphicon glyphicon-hdd"></i>D</span>
                    </div>
                    <div class="col-md-9" style="margin-left:3px; margin-top:1px;">
                        <div class="progress" ng-show="item.freeDiskSpace != -1">
                            <span class="progress-bar" role="progressbar"
                                  uib-popover-html="item.sizeView" popover-trigger="'mouseenter'"
                                  ng-show="item.freeDiskSpace < 15"
                                  aria-valuenow="item.diskRate" aria-valuemin="0"
                                  aria-valuemax="100"
                                  style="min-width: 2em; background-color: #c9302c; width: {{100 - item.freeDiskSpace}}%;">
                                <b>{{100 - item.freeDiskSpace}}%</b>
                            </span>
                            <span class="progress-bar" role="progressbar"
                                  uib-popover-html="item.sizeView" popover-trigger="'mouseenter'"
                                  ng-show="item.freeDiskSpace >= 15"
                                  aria-valuenow="item.diskRate" aria-valuemin="0"
                                  aria-valuemax="100"
                                  style="min-width: 2em; background-color: #20a03f; width: {{100 - item.freeDiskSpace}}%;">
                                <b>{{100 - item.freeDiskSpace}}%</b>
                            </span>
                        </div>
                    </div>
                </td>
                <td>{{item.viewHistory}}</td>
                <td>
                    <b class="fa fa-circle-o"
                       uib-popover-html="'禁用'" popover-trigger="'mouseenter'"
                       style="color: #777" ng-if="item.enabled == 0"></b>
                    <b class="fa fa-circle"
                       uib-popover-html="'启用'" popover-trigger="'mouseenter'"
                       style="color: #449d44" ng-if="item.enabled == 1"></b>
                </td>
                <td>
                     <span class="label" uib-popover-html="item.updateTime"
                           popover-trigger="'mouseenter'"
                           style="background-color: #ff8700; color: white;">采样:{{item.updateTimeView}}</span>
                    <div ng-show="item.enabled">
                        <span class="label" uib-popover-html="item.cleanupTime"
                              ng-show="item.cleanupTime != ''"
                              popover-trigger="'mouseenter'"
                              style="background-color: #ff5f87; color: white;">清理:{{item.cleanupTimeView}}</span>
                    </div>
                </td>
            </tr>
            </tbody>
            <tfoot>
        </table>
    </div>
    <form class="bs-example form-horizontal">

        <div class="form-group">
            <div class="col-md-12">
                <label class="col-lg-1 control-label"></label>
                <div class="col-lg-8">
                    <label style="margin-top:5px;">
                        <input type="checkbox" ng-model="item.enabled">
                        <span class="label"
                              style="margin-left: 10px; background-color: #00a8f3; color: white;">启用日志弹性清理</span>
                    </label>
                </div>
            </div>
        </div>

        <div class="form-group" ng-show="item.enabled">
            <div class="col-md-12">
                <label class="col-lg-2 control-label"><span style="color: #ec2121;">*</span>清理脚本</label>
                <div class="col-lg-6">
                    <select class="form-control" ng-model="nowScript.selected"
                            ng-options="script as script.scriptName + '<' + script.content + '>' for script in scriptList"
                            required>
                        <option value="">--请选择--</option>
                    </select>
                </div>
            </div>
        </div>

        <div class="form-group" ng-show="item.enabled">
            <div class="col-md-12">
                <label class="col-lg-2 control-label"><span style="color: #ec2121;">*</span>归档(天)</label>
                <div class="col-lg-6">
                    <input type="text" class="form-control" placeholder="天数" ng-model="item.history">
                </div>
            </div>
        </div>

        <div class="form-group" ng-show="item.enabled">
            <div class="col-md-12">
                <label class="col-lg-2 control-label">参数</label>
                <div class="col-lg-6">
                    <input type="text" class="form-control" placeholder="可选参数" ng-model="item.scriptParams">
                </div>
            </div>
        </div>

        <div class="form-group">
            <div style="text-align:center;">
                <button ng-click="saveItem(item)"
                        class="btn btn-xs"
                        style="margin-left: 5px; background-color: #2e6da4; color: white;">
                    <span class="glyphicon glyphicon-ok"></span>保存
                </button>

                <!--<span class="glyphicon glyphicon-save" ng-click="saveItem(item)"></span>-->
            </div>
        </div>
    </form>
    <div ng-if="alert.type != ''">
        <div uib-alert ng-class="'alert-' + alert.type" close="closeAlert()">{{alert.msg}}</div>
    </div>
</div>